package xin.zhiyin.仓库.书;

import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;
import xin.zhiyin.实体.书类目Entity;

import java.util.List;

public interface 书类目Repository extends JpaRepositoryImplementation<书类目Entity,Long> {
    /**
     * 批量删除
     * 注意更新和删除是需要加事务的， 并且要加上 @Modify的注解
     * @function 自定义JPQL
     * @param ids
     */
    @Modifying
    @Transactional
    @Query("delete from 书类目Entity s where s.id in (?1)")
    void 批量删除(List ids);
    List<书类目Entity> findByParentId(Long parentId);
}
